<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="embroot.css">
<TITLE>
Basics
</TITLE>
</HEAD>
<BODY >
<A HREF="embroot053.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot052.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot055.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc107">10.2</A>&nbsp;&nbsp;Basics</H2>
<A NAME="remoteprotobasic"></A>
The remote interface is established by <B>attaching</B> the remote and
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> processes. The attachment establishes two socket connections
between the two processes:
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>Control</B><DD CLASS="dd-description"> This connection is used to control the remote
interface. Messages (in EXDR format) are sent in both directions according
to the remote protocol to co-ordinate the two processes.
<DT CLASS="dt-description"><B>Rpc</B><DD CLASS="dd-description"> This is used to send <B>ec_rpc</B> goals from the remote process
to ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> and return the results. The goal is sent in EXDR format.
</DL>
More than one remote attachment can be established in an ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>
process. Each attachment is independent, and is a remote peer,
identified by its control
connection. Each remote attachment has two sides: the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side, and
the remote side. <BR>
<BR>
At any one time, either the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> or the remote side has <I>control</I>. When a side has control, it is able to send messages to the other
side via the control connection. The side that does not have control
waits for messages to arrive on the control connection. On the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>
side, execution is suspended while it does not have control. In general, once a
control message is sent, the control is passed to the other side, and the
side that sent the message waits for a reply message from the other side.<BR>
<BR>
The <B>ec_rpc</B> mechanism is designed to be the main way for the remote
side to interact with the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side. The remote side can send an
ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> goal, in EXDR format to be executed by the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side. This
can only be done while the remote side has control, and when the goal is
issued, a message is sent via the control connection to the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>
side, and control is passed to the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side. Control is passed back
to the remote side when ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> completes the execution of the goal.<BR>
<BR>
After the attachment, extra I/O connections can be established between the
two sides. This allows data to be transferred from one side to the other.
These connections (referred to as peer queues) can be of two types:
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>synchronous</B><DD CLASS="dd-description"> These queues are synchronised by the control
connection. Control messages are exchanged between the two sides to ensure
that they are both are synchronised for the data transfer: one side
consumes the data that is sent from the other. This ensures that no
blocking occurs with the I/O operations across the sockets.<BR>
<BR>
<DT CLASS="dt-description"><B>asynchronous</B><DD CLASS="dd-description"> These queues can perform I/O operations that are not
 co-ordinated by the control 
connection. Either side can write to or read from the queue 
without transferring control. In fact, if the remote language is
multi-threaded, it can perform asynchronous I/O while ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>
side has control. Note that asynchronous I/O
operations may block on the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> side. </DL>
<HR>
<A HREF="embroot053.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot052.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="embroot055.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
